home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_138 / modulatools / modulatools.source / colortools.mod < prev    next >
Text File  |  1992-05-06  |  4KB  |  91 lines

  1. (******************************************************************************)
  2. (*                                                                            *)
  3. (*  Version 1.00a.002 (Beta) :   March 2, 1988                                *)
  4. (*                                                                            *)
  5. (*    These procedures were originally written under version 1.20 of the TDI  *)
  6. (* Modula-2 compiler. I have rewritten this module to operate under the v2.00 *)
  7. (* compiler. However, should you find any problem or inconsistency with the   *)
  8. (* functionality of this code, please contact me at the following address:    *)
  9. (*                                                                            *)
  10. (*                               Jerry Mack                                   *)
  11. (*                               23 Prospect Hill Ave.                        *)
  12. (*                               Waltham, MA   02154                          *)
  13. (*                                                                            *)
  14. (*    Check the module MenuUtils for TDI's (considerably less powerful) ver-  *)
  15. (* sions of my Menu and IntuitionText procedures. The modules GadgetUtils and *)
  16. (* EasyGadgets should also be of great help.                                  *)
  17. (*                                                                            *)
  18. (******************************************************************************)
  19. (*                                                                            *)
  20. (*    The source code to ColorTools is in the public domain. You may do with  *)
  21. (* it as you please.                                                          *)
  22. (*                                                                            *)
  23. (******************************************************************************)
  24.  
  25.  
  26. IMPLEMENTATION MODULE ColorTools;
  27.  
  28. FROM Colors    IMPORT LoadRGB4;
  29. FROM Intuition IMPORT ScreenPtr;
  30. FROM SYSTEM    IMPORT ADR, NULL; 
  31.  
  32.  
  33. (***************************************************************************)
  34. (*                                                                         *)
  35. (*    This procedure allows you to easily change the colors in a Screen.   *)
  36. (* The only parameter required is CurrentScreen, a pointer to the Screen   *)
  37. (* you wish to change. The global array ScreenColors contains the colors   *)
  38. (* which will be loaded into the Screen's ViewPort. Thus, you may change   *)
  39. (* any of the values in ScreenColors prior to calling this procedure to    *)
  40. (* obtain a custom colortable for your Screen.                             *)
  41. (*    In case it isn't obvious, you must first open both the Intuition and *)
  42. (* the Graphics libraries before calling SetScreenColors. Alternatively, a *)
  43. (* call to OpenGraphics (in WindowTools) will enable you to successfully   *)
  44. (* call SetScreenColors.                                                   *)
  45. (*                                                                         *)
  46. (***************************************************************************)
  47.  
  48.    PROCEDURE SetScreenColors (CurrentScreen : ScreenPtr);
  49.                
  50.    BEGIN
  51.       IF (CurrentScreen <> NULL) AND (CurrentScreen <> NIL) THEN
  52.          LoadRGB4(ADR(CurrentScreen^.VPort), ADR(ScreenColors), MaxColors);
  53.       END; (* IF CurrentScreen *)
  54.    END SetScreenColors;
  55.  
  56.  
  57. BEGIN
  58.    ScreenColors[ 0] := Black;
  59.    ScreenColors[ 1] := LimeGreen;
  60.    ScreenColors[ 2] := White;
  61.    ScreenColors[ 3] := Red;
  62.    ScreenColors[ 4] := Violet;
  63.    ScreenColors[ 5] := LemonYellow;
  64.    ScreenColors[ 6] := ForestGreen;
  65.    ScreenColors[ 7] := BrightBlue;
  66.    ScreenColors[ 8] := DarkGreen;
  67.    ScreenColors[ 9] := Brown;
  68.    ScreenColors[10] := Purple;
  69.    ScreenColors[11] := Orange;
  70.    ScreenColors[12] := MediumGrey;
  71.    ScreenColors[13] := Aqua;
  72.    ScreenColors[14] := Tan;
  73.    ScreenColors[15] := Magenta;
  74.    ScreenColors[16] := Pink;
  75.    ScreenColors[17] := LightAqua;
  76.    ScreenColors[18] := CadmiumYellow;
  77.    ScreenColors[19] := Green;
  78.    ScreenColors[20] := DarkBrown;
  79.    ScreenColors[21] := LightGrey;
  80.    ScreenColors[22] := GoldenOrange;
  81.    ScreenColors[23] := DarkBlue;
  82.    ScreenColors[24] := LightGreen;
  83.    ScreenColors[25] := BrickRed;
  84.    ScreenColors[26] := SkyBlue;
  85.    ScreenColors[27] := BlueGreen;
  86.    ScreenColors[28] := LightBlue;
  87.    ScreenColors[29] := RedOrange;
  88.    ScreenColors[30] := Blue;
  89.    ScreenColors[31] := Black;
  90. END ColorTools.
  91.